<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view(TPL_FOLDER."header");?>

<table width="100%" border="0" cellpadding="5" cellspacing="0" >
  <tr>
    <td width="3%" align="left" ><img src="{tpl_path}images/forward.jpg" /></td>
    <td width="97%" align="left" >您现在的位置：邮件发送模板 </td>
  </tr>
</table>
<table cellspacing="0" class="widefat">
  <thead>
    <tr id="trth">
      <th width="21%">模板说明</th>
      <th width="21%">是否开启发送</th>
      <th width="21%">邮件标题</th>
      <th>模板内容</th>
      <th width="16%">操作</th>
    </tr>
  </thead>
  <tfoot>
  </tfoot>
  <tbody id="check_box_id">
    <?php foreach($query->result() as $row) {?>
    <tr>
      <td height="30"><?php echo $row->shuo_ming;?></td>
      <td><?php 
		if( ! $row->status)
		{
		?>
        <img src="{tpl_path}images/no.gif" onclick="ajax_toggle(this,<?php echo $row->id;?>,'<?php echo site_url(CTL_FOLDER."email_template/ajax_toggle");?>')" style="cursor:pointer" title="点击改变状态" />
        <?php
		}
		else
		{
		?>
        <img src="{tpl_path}images/yes.gif" onclick="ajax_toggle(this,<?php echo $row->id;?>,'<?php echo site_url(CTL_FOLDER."email_template/ajax_toggle");?>')" style="cursor:pointer" title="点击改变状态" />
        <?php
		}
		?></td>
      <td><?php echo $row->title;?></td>
      <td><?php echo strcut(replace_htmlAndjs($row->content),40);?></td>
      <td><a href="<?php echo site_url(CTL_FOLDER."email_template/edit_record/".$row->id);?>?url=<?php echo get_curren_url();?>">修改</a></td>
    </tr>
    <?php }?>
  </tbody>
</table>
<?php $this->load->view(TPL_FOLDER."footer");?>
